package com.CoreryBlack.controller;

import com.CoreryBlack.po.CountData;
import com.CoreryBlack.po.JobOption;
import com.CoreryBlack.po.Result;
import com.CoreryBlack.service.ReportService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


import java.util.List;
import java.util.Map;

/**
 * @Description ReportController
 * @Author CoreryBlack
 * @Date 2024-09-19
 */
@Slf4j
@RestController
@RequestMapping("/report")
public class ReportController {

    @Autowired
    private ReportService reportService;

    @GetMapping("/studentCountData")
    public Result countStudentCountData() {

        log.info("countStudentCountData");
        CountData countData = reportService.countStudentCountData();

        return Result.success(countData);
    }

    @GetMapping("/studentDegreeData")
    public Result getDegreeData() {
        List<Map> degreeData = reportService.getStudentDegreeData();
        return Result.success(degreeData);
    }

    @GetMapping("/empJobData")
    public Result empJobData(){

        JobOption jobOption = reportService.empJobData();

        return Result.success(jobOption);
    }


    @GetMapping("/empGenderData")
    public Result empGenderData(){
        List<Map<String, Integer>> genderData = reportService.empGenderData();
        return Result.success(genderData);
    }

}
